When a substrate having electronic components mounted thereon has the risk of being exposed to water, a resin coating has been conventionally applied to the surface of the substrate for protection against water and moisture. For example, Patent Literature 1 describes a technique that a part of a surface of the substrate having connecting portions of lead wires thereon is coated by applying a resin thereto (see, e.g., Paragraph [0044]). The substrate whose surface is partially coated is encapsulated in a resin by insert molding (see, e.g., Paragraph [0049] and FIG. 5). This configuration is designed to enhance waterproofness.